[Git] 09. Remote

Clone

  • Add remote end-point

    $ git remote add origin https://github.com/KarateJB/Test.git
  • Clone

    git clone

Push

  • Push with setting remote upstream branch
    $ git push -u origin {brach_name_for_remote}

Pull

git pull equals to

  1. git fetch
  2. git merger

Pull remote branch

$ git checkout --track origin/<branch>
$ git pull

Pull by rebase (Which will not create a new commit for merging)

$ git pull --rebase

Syncing a fork

$ git fetch upstream
$ git checkout master
$ git merge upstream/master
Table of contents
  1. 1. Clone
  2. 2. Push
  3. 3. Pull
    1. 3.1. Pull remote branch
    2. 3.2. Pull by rebase (Which will not create a new commit for merging)
  4. 4. Syncing a fork